﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/BlogAdmin.Master" AutoEventWireup="true" CodeBehind="PostCategoryList.aspx.cs" Inherits="Press.MVC.Web.Views.BlogAdmin.PostCategoryList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<%= Html.Validation().ValidatorRegistrationScripts() %>
</asp:Content>

<asp:Content ID="indexContent" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
 
 Post Category Listing page
 <br />
 
  <%using (Html.Form("BlogAdmin", "PostCategoryDelete", FormMethod.Post))
   {%>
   
   <%= Html.SubmitButton("deletepost","Delete")%>
    <br /> <br />
   <table>
   <tr>
<td>
   &nbsp;
</td>

<td>
    Name
</td>
<td>
    Posts
</td>
</tr>

   <%foreach (Press.MVC.Data.PostCategory pc in ViewData.Model.PostCategories) { %>
      <%=Html.RenderAppControl("BlogAdmin/CategoryListing.ascx",pc)%>
   <%} %> 
   
   </table> 
       
    
<%}%>
 
 <% using (Html.Form("BlogAdmin", "PostCategorySave", FormMethod.Post, Html.Validation().FormValidation("required"))) { %> 
 
   
   <%= ViewData.Model.Blog.ID.ToString()%>
   
    <%= Html.Hidden("blogid", ViewData.Model.Blog.ID.ToString())%>
   <br /><br />
   Add new Category <br />
   
   Category Name <%= Html.TextBox("CategoryName") %>
   <%= Html.Validation().RequiredValidator("bodyVal", "CategoryName", "You must supply a Category Name.", "required")%>
   <br />
    <br /><br />
    <%= Html.Validation().ValidatorInitializationScripts() %>
   <%=Html.SubmitButton("addcategory","Add Category") %> 
                                 
 <%} %> 
 
</asp:Content>